#include <AST/expr/literal/BoolAST.hpp>
#include <global.hpp>

Bool::Bool(bool val) : val(val) {
    cachedValue = llvm::ConstantInt::getBool(theContext, val);
}

llvm::Type *Bool::getType() {
    return BasicType::BoolTy;
}

llvm::Constant *Bool::codegen() {
    return static_cast<Constant *>(cachedValue);
}

llvm::Value *Bool::getDefault() {
    return llvm::ConstantInt::getBool(theContext, false);
}
